package com.nantai.jiafang.nantaijiafang.ViewModel;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;

/**
 * Created by admin on 2017/12/1.
 */

public class Image_load {
    public static void load(Context context, ImageView iv, String url) {
        load(context, iv, url, null);
    }

    public static void load(Context context, ImageView iv, String url, String refererUrl) {
        Drawable error;

        /*if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            error = context.getDrawable(R.drawable.error);
        } else {
            error = context.getResources().getDrawable(R.drawable.error);
        }*/
//一般直接通过网址加载
        Glide.with(context).load(url).into(iv);
    }
}